<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="UTF-8">
        <title>Remote Connection</title>
        <link rel="stylesheet" th:href="@{/css/font.css}">
        <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
        <link rel="stylesheet" th:href="@{/css/xadmin.css}">
        <script type="text/javascript" th:src="@{/layui/layui.js}"></script>
        <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
        <style>
            .file {
                position: absolute;
                width: 104px;
                height: 38px;
                position: relative;
                display: inline-block;
                padding: 4px 12px;
                overflow: hidden;
                text-decoration: none;
                text-indent: 0;
                line-height: 20px;
                margin-bottom: -14px;
                z-index: 99999;
            }
            .file input {
                position: absolute;
                font-size: 100px;
                right: 0;
                top: 0;
                opacity: 0;
            }
        </style>
    </head>
    <body>
        <div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a>
              <cite>配置列表</cite></a>
          </span>
          <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">


                        <div th:if="${active == 'local'}" class="layui-card-header">
                            <form class="layui-form" action="">
                                <div class="layui-form-item">
                                    <label class="layui-form-label" style="line-height: 27px;margin-left: -38px;">存储方式</label>
                                    <div class="layui-input-inline">
                                        <input type="checkbox" name="jsonAndCookie" id="jsonAndCookie" lay-filter="jsonAndCookie" lay-skin="switch" lay-text="本地json|网页cookie">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux" style="line-height: 27px;margin-left: -95px;">
                                        默认存储在Cookie,也可设置本地json方式存储
                                        <button type="button" style="margin-top: -5px;margin-left: 6px;" id="help" class="layui-btn layui-btn-xs" lay-event="exportData" >
                                            <i class="layui-icon layui-icon-help"></i>
                                            查看帮助</button>
                                    </div>
                                </div>
                            </form>
                        </div>

                        <div th:if="${active == 'server'}" class="layui-card-header">
                            <form class="layui-form" action="">
                                <div class="layui-form-item">
                                    <div class="layui-form-mid layui-word-aux" style="line-height: 27px;">
                                        <span style="font-weight: 700;color: #009688;">注意</span>:默认存储在Cookie,当前为服务器环境,部署本地后可使用json环境存储
                                    </div>
                                </div>
                            </form>
                        </div>


                        <div class="layui-card-body ">
                            <table class="layui-table layui-form" lay-filter="dataTable" id="dataTable"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div> 
    </body>
    <script type="text/html" id="toolbar">
        <div class="layui-btn-container">
            <button class="layui-btn" onclick="xadmin.open('添加配置','/adminAdd')"><i class="layui-icon layui-icon-add-circle-fine layui-font-15"></i>添加</button>
            <a type="button" class="layui-btn" lay-event="exportData" >导出JSON</a>

            <div class="file">
            　　<input id="importData" type="file" multiple >
            </div>
            <a type="button" class="layui-btn" style="margin-left: -104px;">导入JSON</a>
        </div>
    </script>
    <script type="text/html" id="toolbar2">
        <div class="layui-btn-container">
            <button class="layui-btn" onclick="xadmin.open('添加配置','/adminAdd')"><i class="layui-icon layui-icon-add-circle-fine layui-font-15"></i>添加</button>
        </div>
    </script>
    <script th:src="@{/js/base64.js}"></script>
    <script type="module" th:src="@{/js/admin/admin-list.js}"></script>
</html>